#ifndef EVENTLOOP_EVENTLOOP_H
#define EVNETLOOP_EVENTLOOP_H

#include "utility/Noncopyable.h"
#include "thread/current_thread.h"

class Eventloop
{
public:
    static Eventloop *LOOP_OF_CURRENT_THREAD();

    Eventloop(/* args */);
    ~Eventloop();

    void loop();
    void assert_in_this_thread(const char *func, const char *file, int line) const;
    bool is_in_this_thread() const;

private:
    NONCOPYABLE(Eventloop);

    bool _looping;
    const int _tid;
};


#define ASSERT_IN_THIS_THREAD() \
    assert_in_this_thread(__func__, __FILE__, __LINE__)
#endif